home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Science / Concurrent GraphPlot 1.2 / GraphPlot Manual (TEXT) < prev    next >
Text File  |  1993-07-30  |  35KB  |  295 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6. Scientific Graph Plotting for the Apple Macintosh
  7.  
  8.  
  9. USER MANUAL
  10. GraphPlot II
  11.  
  12. User Manual
  13. ©1993 by Graham Cox.
  14. version 1.2, July 28th 1993
  15.  
  16. 1. Introduction
  17.  
  18. GraphPlot II is an application for generating graphs of mathematical functions. It was written to address the needs of students wishing to incorporate such graphs into coursework documents, and offers a cheap and easy to use solution for those studying science, engineering or mathematics. It is also useful for exploring mathematical functions in general. It grew out of my own needs while I myself was a student, and as far as I know is the only shareware package available for this job. Programs such as MathCAD and Mathematica, which no doubt can also perform this task, are both difficult to learn and use, and expensive. GraphPlot II is not a mathematics package in this sense, being limited in both power and scope; however, it does allow nice looking graphs to be ‘knocked up’ very quickly, and cut and pasted into your favourite word processor or graphics program.
  19.  
  20. 2. A Quick History
  21.  
  22. The original GraphPlot was a ‘quick and dirty’ program which produced a similar output to GraphPlot II, but required recompilation and often large amounts of re-writing for each new function that I wanted. As a result, I often spent more time reprogramming it to get just the graphic I required than studying the subject in hand... By combining the graph plotting core of the original GraphPlot with a lexical analyser for mathematical functions, and adding a user friendly interface and colour, GraphPlot II was born. Being greater than the sum of its parts, I found GraphPlot II invaluable as a tool, and I hope you will too. By making this program, which has been polished far beyond its original humble goals, available as shareware, I hope I am addressing the needs of science students everywhere. As a student, I know how unaffordable most software packages are, and the strict licensing laws applying to educational sites makes the illegal copying of such packages a highly risky affair. So, GraphPlot II is, above all, very cheap. If you use this program, all I ask in return is £10 Sterling, or your local equivalent (say $15-20 US Dollars in the States), which I’m sure you’ll agree is a bargain! GraphPlot II took a considerable amount of time and effort to program to make your life easier, so make mine easier by taking the few minutes needed to pop the shareware fee into an envelope! The address to send it to is at the end of this manual, and is reproduced in the ‘About’ dialog within the program itself.
  23.  
  24. 3. The User Manual Proper...
  25.  
  26. System Requirements
  27.  
  28. GraphPlot II will work on any Macintosh running System 6 or greater. It supports colour on colour machines, and loves System 7.
  29.  
  30. Installing GraphPlot II 
  31.  
  32. It’s a breeze... just drag the application icon to your hard disk, or run it from a floppy if you want. To run it, simply double-click it, but you knew that anyway. Graphplot II usually requires about 400k of RAM to run in, but will work with considerably less if the number of open windows is kept down.
  33.  
  34.  
  35. fig.1.
  36.  
  37. When GraphPlot II is run, you will get a new ‘Untitled’ window (fig. 1.) with a default linear graph scale displayed. You can immediately plot functions into this window, and there are two ways of doing this:
  38.  
  39. Built-in functions.
  40.  
  41. The ‘Functions’ menu is stacked with pre-defined functions commonly found in science and engineering. Simply choose the desired function, and it will be immediately plotted using a suitable choice of axes.
  42.  
  43. Defining your own function.
  44.  
  45. Selecting ‘Define Function’ (Command-F) in the Functions menu presents a dialog box (see below, fig. 2) which allows you to type in any algebraic expression. This is entered in standard form for computer expressions- even if you have no programming experience it is quite straightforward- and if you are familiar with BASIC (or hopefully something better) it will be a piece of cake. The illustration shows the general quadratic formula f(x) = ax2+bx+c.
  46.  
  47.  
  48. fig. 2.
  49.  
  50. In GraphPlot II, all functions are considered to be a function of x, that is, f(x). x is known as the primary variable  or the independent variable, and is always represented by the horizontal axis. The dependent variable, i.e. the function result f(x), is always represented on the vertical axis. This axis is often labelled ‘y’, and this reference is also used in this program. This convention is universally used and is a basic assumption of the program. If you have an expression in some other variable, e.g t is used in a lot of engineering, it is necessary to express the function in terms of x. Usually this is only a matter of simple substitution. GraphPlot II therefore expects an expression in terms of x, but will happily attempt to plot graphs of functions of other variables- however, note that f(x) = a * 3 will draw a horizontal line at y = zero! You can have coefficients and other variables in your expression- GraphPlot II treats them as constants and allows you to set these at will. See the section below on secondary variables for a complete explanation.
  51.  
  52. Valid expressions
  53.  
  54. An algebraic expression can have a maximum of 255 characters, and can contain any mixture of numbers (both integer and floating point), binary operators (+,-,*,/,^), left and right brackets, unary operators as given below, and labels. Any string that is not a unary operator (which are all reserved words) is considered a label and will be assigned to a secondary variable. The variable x is treated as the primary variable.
  55.  
  56. Unary Operators
  57.  
  58. The following unary operators are available:
  59.  
  60. SIN    Sine of the argument in radians
  61. COS    Cosine of the argument in radians
  62. TAN    Tangent of the argument in radians
  63. EXP    e raised to the power of the argument
  64. LOG    Logarithm to the base e of the argument
  65. SQRT    Square root of the argument
  66. ATN    Arctangent of the argument (in radians)
  67. ABS    The absolute value of the argument
  68. NEG    The negation of the argument
  69. PLS    Dummy operator- has no effect, but is still a reserved word.
  70.  
  71. Note that the unary + and - operators can be written either as + and - or PLS and NEG. The program figures out the difference between the unary and binary operators from the context.
  72.  
  73. The f(x)= (or y=) is implicit- you should only enter the right hand side of the equation.
  74.  
  75. Brackets are used to alter the precedence of operators, and to delimit the arguments of unary operators. The natural precedence of binary operators, from greater to lesser, is ^, * and /, + and -. Unary operators have higher precedence still.
  76.  
  77. The analyser is not case sensitive; e.g. LOG, log, Log, loG are all equivalent. Whitespace (i.e. spaces, tabs) in the expression are ignored and can be added for readability. Bear in mind however, that the limit of 255 characters in an expression includes these spaces.
  78.  
  79. Examples
  80.  
  81. The following are all valid:
  82.  
  83. SIN(x)    returns the sine of x (x in radians)
  84. x^2 + 3*x +2    simple quadratic
  85. (1+cos(x)*0.9)*cos(20*x)    amplitude modulation formula
  86. 1-exp(-sigma*x)*(cos(x*omega)+sigma/omega*sin(omega*x))
  87. etc...
  88. In the last case, sigma and omega are secondary variables.
  89. The following are not valid:
  90.  
  91. SINx    will be considered a variable ‘sinx’
  92. x^2 + 3x +2    ‘3x’ for 3*x is not allowed
  93. 1+cos(x)*0.9)*cos(20*x)    Parentheses must balance
  94.  
  95. It is instructive to look at the formulae that the built-in functions supply as further examples, or to modify them. To do this, plot the built in function by selecting it from the menu, then choose ‘Define Function’. The formula for the current graph will be highlighted in the dialog. Editing works in the normal (Mac) way.
  96.  
  97. You can use the Define Function dialog as a simple calculator. Enter the expression, then a value for x. Click ‘Evaluate’ to instantly display the result. This is also useful as a syntax check on the expression.
  98.  
  99. Axes
  100.  
  101. When you enter your own function, GraphPlot II has no way of knowing in advance what a suitable range of values to plot the function over would be, and so simply tries to plot the function on the current axes. The built in functions specify their own axes because they are known in advance. It may be useful to plot a new function over quite a wide range and see roughly where the limits lie, then change the scales to suit. Scales are changed using the ‘Scales’ command in the ‘Setup’ menu, or by dragging a selection marquee around an area of interest and choosing ‘Expand Selection’ or ‘Extract Selection’ from the Edit menu. To drag a selection, select the marquee tool in the graphplot window, and drag the mouse in the graph area.
  102. n.b. Holding down the Shift key while choosing a built-in function will plot that function on the current axes, rather than the stored axes.
  103.  
  104. Scales Dialog
  105.  
  106. The Scales dialog allows the ranges and types of the x and y axes to be set independently. (See fig. 3. below). You can also set the number of scale divisions (or decades for log scales). This affects the way the gridlines are drawn. Simply enter the values for the upper and lower limits for each scale, the number of divisions required, and click OK. The graph will be immediately replotted as long as ‘Always Replot’ is checked. If this is not checked, the command ‘Plot Graph Now!’ (Command-G) will replot the graph with the new settings.
  107.  
  108.  
  109. fig. 3.
  110.  
  111. The linear x axis may be set to operate in multiples of pi, useful for plotting circular functions, etc. If the ‘xπ’ check box is checked, the limit values entered for the x axis are taken as multiples of pi. e.g. to plot from -π to +π, you would enter -1 and 1 into the limits for x, then check the ‘xπ’ checkbox. The axis will be labelled accordingly and the graph takes π into account when plotting.
  112.  
  113. Selection Marquee
  114.  
  115. A selection marquee can be dragged in the current graph in the usual way by selecting the marquee tool and dragging. This will create a ‘marching ants’ selection which can then be used to set the scales for the graph. This is done by choosing ‘Expand Selection’ from the Edit menu. This allows a portion of a function to effectively be ‘zoomed into’. Alternatively, a new window can be opened with the selected area of the current graph as its scales. The function and all the other attributes are copied from the current graph, but once opened, it can be treated as an entirely seperate entity. This is done with the ‘Extract Selection’ command under the Edit menu.
  116.  
  117. Log Scales
  118.  
  119. Either axis can be set to a log scale. Graphs of this type are often used in electronic engineering for Bode plots, etc. Log scales always use log base 10, and the number of cycles or decades is set using the Scales Dialog. More than 6 cycles in the x axis or 3 in the y axis is not recommended as the crowded gridlines tend to make the graph unreadable. The origin of the log scale is set with the Scales dialog too. This is the value that the leftmost (or bottom-most in case of the y axis) edge of the log scale is based on, and should be a simple power of 10, e.g 0.1,1,10,100 etc. GraphPlot II will accept other values but the resulting graphs do not necessarily make sense mathematically! If you are using log scales, this is an important point to bear in mind.
  120.  
  121. Labelling
  122.  
  123. GraphPlot II allows you to define labels for both axes and also a main title for the graph. This is done with the ‘Labels’ dialog. (fig. 4.) Simply type in the labels you require and select the checkboxes to instruct the program which items to draw, then click OK. The Labels dialog also allows you to set the number of decimal places and the point size to use when labelling scales. In this version of GraphPlot II, the font choice used for the labels is fixed (Geneva), but you can of course use any graphics editor to change this if you require something different. The scale gridlines can be drawn using either a solid pattern or the 50% gray pattern. This is also selected using the labels dialog.
  124.  
  125. fig. 4.
  126.  
  127. Defining Secondary Variables
  128.  
  129. This feature is provided for two main purposes. They are: a) for setting coefficients in generalised expressions, and: b) for plotting multiple trace graphs where the value of a variable changes from one trace to the next. Both functions are accomplished using the ‘Secondary Variables’ dialog (see fig. 5, below). When the dialog is called up, all secondary variables that are defined in the current formula are listed in the scrollable list on the left. Note that the variable ‘x’ never appears in this list, as it is not a secondary variable.
  130.  
  131. Coefficients
  132.  
  133. If a formula contains coefficients in symbolic form, e.g. y = mx+c for the generic straight line, the coefficients m and c can be set simply by clicking on the variable name in the list, and typing the required value into the edit box labelled ‘Start at:’ Clicking OK then assigns the values to the variable names, and these values will be substituted for the names when the graph is plotted.
  134.  
  135. Multiple Traces
  136.  
  137. For multiple trace graphs, the values of each secondary variable can be incremented automatically from one trace to the next. First specify the starting values as outlined above, then enter the increment (or negative value for a decrement) which will be applied each time the formula is plotted. Enter the number of times you wish to plot the function, then click OK. The graph will be plotted using the set parameters. Note that because a fixed increment is used, the secondary variables can only be changed according to a linear law, but for the majority of purposes, this will be adequate. Non-linear arrangements can usually be accommodated by inclusion of suitable terms in the original formula. Checking the ‘Auto colour each trace’ button in the dialog will plot the graph using a different colour for each trace, provided you have a colour capable Macintosh of course!
  138.  
  139.  
  140. fig. 5.
  141.  
  142.  
  143. 4. Program Output.
  144.  
  145. GraphPlot II generates QuickDraw PICTs and it is envisaged that the cut-and-paste facility will be the most commonly used method of exporting the graph images, especially when using MultiFinder or System 7, where you can run GraphPlot II alongside your favourite word processor. To copy the current graph to the clipboard, simply choose ‘Copy’ (Command-C) from the edit menu. If you hold down the option key when choosing this command, the graph will be converted to a bitmap image before it is placed on the clipboard. For some applications, this may be desirable, but the bitmap image has a fixed resolution of 72dpi and will not resize very well, and neither will it print terribly wonderfully. GraphPlot II also allows you to save graphs either as a PICT file or in a special format that allows GraphPlot II to open the files and create a graph from them at a later time. The usual commands for Open andSave are found in the file menu for this purpose. The graph below (fig. 6.) was directly cut and pasted from GraphPlot II and illustrates numerous features of the graph plotting facilitiies.
  146.  
  147.  
  148. fig. 6.
  149.  
  150. Printing
  151.  
  152. Standard Macintosh printing is fully supported. Graphs are printed horizontally centred on the page, a little way down from the top. Coloured graphs can be printed correctly on colour printers. Because a graph is drawn using QuickDraw commands, it is largely resolution independent and will yield excellent results on high resolution printers. Page Setup and Print commands (File menu) work in the usual way for a Mac application.
  153.  
  154. The rest of the File menu...
  155.  
  156. The ‘New’ command opens a new ‘Untitled’ window into which you can plot graphs. You can have as many concurrently open windows as memory allows. The Close command closes the current window, prompting the user to save it if it has been altered in any way since it was opened. Holding down the option key changes this to ‘Close All’, in which case every window is closed, and the user is prompted to save any that have changed. If you want to override the ‘save’ prompt when closing a lot of windows, hold down the command key as well when choosing ‘Close All’. Option-clicking or Option-Command-clicking the topmost window’s close box achieves the same effect. ‘Quit’ is obvious, one hopes...
  157.  
  158. Resolution
  159.  
  160. Plotting a ‘continuous’ function on a computer screen involves some compromise, as it is impossible to truly obtain a continuous function (it would take an infinite amount of time to plot, for one thing!). So, discrete intervals of the primary variable (x) are used. These discrete intervals mean that the graph plotting software becomes a sampled data system, and as such is subject to the problem of aliasing. In GraphPlot II, the software can calculate a reasonably adequate sampling interval for itself based on the current size of the graph on the screen and the scales used for the graph. There is little point in trying to plot more accurately than 1 pixel between samples, and so this is used as a starting point, then the sampling interval is doubled. For most graphs, the resulting resolution is entirely adequate, and aliasing artefacts will not appear. For some functions, particularly those involving trigonometric functions of high multiples of x (that’s high frequency sine waves to you and me), the sampling interval may need to be reduced to correctly plot the peaks of the waveform. This is done using the ‘Resolution’ dialog box (fig. 7.) in conjunction with the ‘Auto Resolution’ menu command. When Auto Resolution is checked, the graph will always be plotted using the calculated sampling rate. When unchecked, you can set the sampling interval manually. The Resolution dialog box will initially display the value that x will be incremented by as computed for Auto Resolution. Normally, setting this to a value of one-half to one-third of its computed setting will give good results. There is a trade off between plotting resolution and plotting time- when sampling more often, it takes longer to draw the entire function. The curve is actually drawn as a series of straight lines- normally this effect is unnoticeable but setting the sampling interval to a very large interval will show this up. This is equivalent to a first-order sampling system which interpolates linearly between successive samples.
  161.  
  162.  
  163. fig. 7.
  164.  
  165. Discontinuities
  166.  
  167. If a function exhibits discontinuities (e.g. the tangent function), GraphPlot II attempts to plot the curves correctly by NOT plotting the line joining ± infinity! However, the resolution setting has a bearing on this, because if the resolution is too low, the sampling points may not come close enough to the discontinuity to detect it correctly, and some extraneous parts of the curve may appear. If this occurs, try increasing the resolution by making the x increment smaller.
  168.  
  169. Window Management
  170.  
  171. GraphPlot II’s Windows menu allows quick and simple window management, which is a useful feature if you have a lot of windows open at once. Every new window is added to the menu and can be brought to the front by choosing it from the menu. The current front window is indicated by a diamond mark next to the title. Windows can be stacked from bottom to top on the screen with the ‘Stack Windows’ command, or tiled across the available screen space with the ‘Tile Windows’ command. Note that both of these commands temporarily turn off the ‘Always Replot’ flag so that the operation can be performed rapidly. The images of the graphs that are shown are scaled from the previous drawn size, and you may want to use the ‘Plot Graph Now!’ command to redraw them at the correct size. Also note that the ‘Copy’ command places the image at its original size onto the clipboard. To be sure of a ‘WYSIWYG’ copy of the graph, always replot the graph before copying if the ‘Always Replot’ flag is off, or if you stacked or tiled the windows recently. Holding down the option key while selecting  Tile Windows will force a horizontal precedence if there are only two or three windows, rather than a vertical one. Holding down the option key while selecting Stack Windows will stack the windows without resizing them.
  172.  
  173. Colour
  174.  
  175. On colour capable Macintoshes, the colours of the graph background, scale and trace can be individually set. This is done simply by selecting a colour from the pop-up menu palette which is displayed when one of the colour ‘chips’ in the window’s tool bar is clicked. 81 different colours are displayed on 256 colour machines or greater- on 16 colour machines you get 16 colours (or greys) No surprise there. The pop-up menu will not be available if you have the main screen set to black & white (or 4 greys/ colours), or if you are running GraphPlot on a classic type Mac. The colours are chosen to give a reasonably wide range without resorting to a huge menu. Different types of printer will give different results with coloured graphs- for most common printers, boring old black & white is probably best, although colour printers will print coloured graphs correctly.
  176.  
  177. Other Features
  178.  
  179. GraphPlot II is an example of a ‘threaded’ application. That means it can (apparently) run more than one process at a time. This feature was a relatively late addition to the software which is why it does not get too much of a mention in this manual, but it is an important contribution to the usability of the program. All graph plotting is done as a concurrent thread, which means that you can set a graph plotting, then go away and open another one, set that plotting, switch to another application... quite funky! It is of great credit to the Apple ATG group whose threads code I used that I could drop threads into this application at such a late stage with ‘only’ a long night of hacking... Anyway, this concurrency does mean that you have full access to the menu bar while a graph is plotting, and so the ‘Plot Graph Now!’ command changes to ‘Abort Plot’ while a plot is in progress in the active window. Holding down the option key while pulling down this menu changes this command to ‘Plot All’, which will start every currently open graph window replotting its function. This is very useful after performing a window tiling operation. Command-Period can also be used to abort the current plot. This leaves the graph incomplete, but can save hours of frustration! Saving or Copying the graph will automatically abort plotting if the graph is incomplete.
  180.  
  181. GraphPlot II fully supports opening and printing files from the Finder. The clipboard can be viewed using the ‘Show Clipboard’ command in the Edit menu. 
  182.  
  183. Version History
  184.  
  185. v1.0  Released May 1993. Full featured, but...
  186.  
  187. v1.1, July 1993 
  188.  
  189. Fixes a number of bugs- window update method changed to work properly when plotting concurrently. No longer fails on classic Macs which don’t have colour Quickdraw. Extract Selection now correctly sizes the daughter window. Secondary Variable dialog has been enhanced slightly. Low memory situations are handled better. Copy to clipboard now clips only the selection if one is made, if not the original behaviour is followed.
  190.  
  191. v1.2, July 18th, 1993
  192.  
  193. I can’t seem to leave the damn thing alone... Fixes bug where Page Setup caused a crash if a plot is in progress when memory is tight (the plotting code got unloaded while the thread was still executing it- A Very Bad Thing.) User interface enhancement- now has most functions and dialogs accessible via clickable tools in the main window. Colour pop-ups now accessed via clickable ‘chips’ in toolbar rather than menu- much more convenient. See new manual section on the tool bar for a full guide to the new features.
  194. GraphPlot II Menu Reference
  195.  
  196. File Menu.
  197.  
  198.  
  199.  
  200. New    Opens a new ‘Untitled’ graph window & makes it the active window.
  201. Open...    Allows a previously saved graph file to be opened into a new window.
  202. Close    Closes the active window. Holding down the option key changes this to         ‘Close All’.
  203. Save PICT as...    Saves the current graph as a PICT file.
  204. Save As...    Saves the current graph as a GraphPlot II file that can be opened with the     ‘Open’ command.
  205. Page Setup...    Displays the Page Setup dialog box for the current printer.
  206. Print...    Allows the current graph to be printed. The standard print dialog is             displayed allowing the number of copies, etc to be set.
  207. Quit    Quits GraphPlot II after saving any changes to open windows.
  208.  
  209.  
  210. Edit Menu
  211.  
  212.  
  213.  
  214. Undo    GraphPlot II does not currently support the Undo feature.
  215. Cut    In dialog boxes, cuts the current text selection & puts it on the             Clipboard.
  216. Copy    In dialog boxes, as above but places a copy of the text on the Clipboard.         Copies the current graph to the Clipboard as a PICT drawing. Holding         down the option key copies the current graph as a bitmap image to the         Clipboard.
  217. Paste    In dialog boxes, replaces the selected text with any text on the             Clipboard.
  218. Clear    GraphPlot II does not implement this command.
  219. Extract Selection    Opens a new window with scales set to the selection in the current             window. The formula is copied to the new window and plotted.
  220. Expand Selection    Changes the scales of the current graph to equal the selected area, and         replots the function.
  221. Select All    Sets the selection area to the entire graph.
  222. Show Clipboard    Displays the contents of the Clipboard in a movable, resizeable window.         GraphPlot II’s Clipboard window includes a ‘Size to Fit’ button so that         very large or very small images can be viewed more easily.
  223.  
  224.  
  225. Setup Menu
  226.  
  227.  
  228.  
  229. Scales...    Displays dialog for setting scale ranges and types for the graph, and the         number of divisions on each scale.
  230. Secondary Variables...
  231.     Displays dialog for assigning numerical values to secondary variables,         and setting up multiple trace graphs.
  232. Labels...    Displays dialog for entering labels for the graph scales, a graph title and         the size and number of decimal places to draw the scale labelling in.
  233. Resolution...    Displays dialog for entering the increment of x to use when plotting the         function. Normally this is calculated automatically.
  234. Auto Resolution    When checked, the x increment is set to a ‘sensible’ value. When             unchecked, the value entered in the Resolution dialog is used.
  235. Always Replot    When checked, the graph is automatically redrawn whenever it is resized     or when any parameter changes, such as scale setup, colour, etc. For         some complex functions, this can become tedious, and so turning it off         is useful to make a set of changes before replotting.
  236. Plot Graph Now!    Replots the current graph. If ‘Always Replot’ is OFF, this command is         used to plot the graph when required. In conjunction with the Option         key, replots all open graphs.
  237.  
  238.  
  239. Functions Menu
  240.  
  241.  
  242.  
  243. A general set of common scientific and engineering functions are included as presets, grouped into categories as shown. Simply select the desired function (the above snapshot shows the examples in the Fourier Series sub-menu) and it will be plotted in the current window with an appropriately chosen set of scales.
  244.  
  245. User Defined    Displays a list of GraphPlot II files located in a folder called “User             Defined” which is in the same directory as the GraphPlot II application.         Selecting the item will open the file into a new window. This is a             shortcut form of the ‘Open...’ command.
  246. Recent    Displays a list of the last 16 functions entered using the ‘Define             Function’ dialog box. Selecting the item recalls the function, but NOT         the scale set up in use at the time.
  247. Define Function...    Displays a dialog allowing any algebraic expression to be entered and         subsequently plotted.
  248.  
  249. Windows Menu
  250.  
  251.  
  252.  
  253. Stack Windows    Stacks all open graph windows from bottom to top so that the title bars         of all windows are visible.
  254. Tile Windows    Tiles all open graph windows to fit the screen. Up to 12 windows can be     tiled. If there are more than 12, the first 12 are tiled, the rest ignored.
  255.  
  256. The rest of the menu lists the currently open windows, with the active one indicated by the diamond symbol. Simply choose the desired item to make it the active window.
  257.  
  258. GraphPlot II Toolbar Reference
  259.  
  260. Graphplot II Technical Appendix.
  261.  
  262. For the curious, or the brave, it is possible to extend the built-in preset functions available. If you have a little experience of ResEdit, this is actually not that difficult. But first, the usual warnings... Knowledge of ResEdit is assumed here- if you aren’t sure, there are some good guides around, including the one from Apple. If you can’t be bothered to get a book, then be warned that ResEdit is possibly one of the most powerful utilities around on the Mac, and like a scalpel, it can be precision tool in the right hands, very dangerous in the wrong ones... So, work on a copy. PLEASE DO NOT DISTRIBUTE MODIFIED VERSIONS OF GRAPHPLOT. While I encourage copying of the program, having hundreds of slightly different versions out there is a technical support nightmare, so if you give a copy to a friend (please do!) make sure it is the original unmodified version. OK, warnings over, now... back to the records...
  263.  
  264. Three resource types are involved, of which two you’ll have to create and define yourself (don’t worry, it’s very easy), the third is created for you by the program. The types are ‘FUNC’, ‘MMAP’ and ‘GSCL’. If this means nothing to you, then stop right here and forget it.
  265. Still here? OK, the FUNC resource describes a function as two strings, a name string and an expression string. Templates for this and the MMAP resources are included, so just open up your COPY of GraphPlot II with ResEdit, and double click the FUNC icon. Create a new resource of this type and then simply enter the name for the function, and the expression string. The name can be anything you want, as descriptive or as terse as you like (this is what’ll appear in the menu). The expression is the actual algebraic expression for the function, and must follow all the rules for expressions outlined earlier in this manual. You should name the resource, and make it purgeable. Make a note of the ID number- ResEdit will have allocated it a free number in the legal range. Then open the GSCL resource icon. DO NOT create a resource of this type- the program will do it for you, (its format is really too complicated to edit by hand anyway), but you do need to note what ID numbers are NOT already in use. Choose a number greater than 128 and less than 10000 that is not already defined. Then open the MMAP resource type. You will see a set of resources corresponding to each of the preset submenus available in the Functions menu. Open the one you want to add your function to. Scroll down to the bottom of the list, and click on the last ‘-----’ marker, and select New Resource. Two edit boxes will appear- in the first, marked FUNC ID:, type the ID number of the function you just added. In the second, marked GSCL ID: type the ID number you just decided to use for the GSCL resource. By the way, the GSCL resource contains all the data for the scales of the graph, in case you were wondering. OK, save the file and close it. Run the modified copy of GraphPlot II. Your function should appear in the menu you chose. Selecting will plot the function on the current scales- because there is no GSCL resource created for the function yet, GraphPlot II doesn’t know what else to do... So, change the scales to something you like (or better still, something meaningful to the function being plotted). When it’s all looking good, hold down the Command + Option keys and choose the name of your function again. The current setup will be saved as a GSCL resource with the ID number you chose, and from now on, choosing your function will change the scale setting accordingly. Note that this Command+Option resource saving works for all the predefined functions (that’s how they were done in the first place after all) so should be used with care if you don’t want to upset the scale setups for the existing functions.
  266.  
  267. Graphplot Copyrights, Shareware info, etc...
  268.  
  269. This is the bit no-one ever bothers to read? Well, perhaps, but here is my opportunity to try and prick your conscience and get some money out of you... GraphPlot II took about 3 or 4 weeks to write, on and off, but mainly on. If I was getting paid the rate I normally get for software writing (I am a professional software writer in my spare time, as well as a student, if that’s not a contradiction in terms) I would have earned about £1,300 at a flat rate for the time I spent on this, if I was doing it as a contract job, it could have been as much as £3,200. As it is, I did it for free... until users send me their shareware fees of course. Now, I think £10 (or $20) is a pretty reasonable amount to charge for this, and be honest, it only takes a minute to put cash in an envelope, scribble my address on the front and post it. If I can get 300 users worldwide to do that, then I’ve amply covered my potential earnings capacity. So please, if you use this software, and consider it to be any good, then pay for it. If on the other hand, you think it’s crap, well fair enough, but give it to a friend- maybe someone else can use it. And if you really feel strongly enough that its crap, or you think its OK but could be better, then drop me a line- I’m very willing to listen to constructive criticism!
  270. My address is...
  271.  
  272. Graham Cox,
  273. 6, Hellesdon Mews,
  274. Hellesdon Mill Lane,
  275. Norwich, NR6 5DA
  276. UNITED KINGDOM
  277.  
  278. Disclaimer
  279. GraphPlot II is supplied ‘as is’ and its suitability for any particular purpose is not guaranteed. I cannot be held responsible for any losses arising out of the use or misuse of this software. It has been thoroughly tested, and should operate on all Macintosh computers meeting the system requirements outlined in the manual. Fair enough, I reckon... What more do you want for ten quid?
  280.  
  281. Carrots and Self-promotion
  282.  
  283. I have written quite a lot of software in my seven years as a professional Mac programmer (admittedly some of the early stuff is a bit dire...) and a lot of it is free. Games, Utilities, all sorts really. If you send me a disk with your shareware fee, I’ll fill it with a pile of this stuff and return it to you.
  284.  
  285. GraphPlot II is Copyright ©1993 Graham Cox. All Rights Reserved. Specification is subject to change without notice (that means it’ll get better and better...). No part of this software may be redistributed in modified form, and no part may be removed and used as part of any other software without the express permission of the author in writing. This program was written using the THINK C development system from Symantec and contains portions of code Copyright © Symantec corporation. This documentation must accompany all copies made of the software in unmodified form. Users may print a single copy of this documentation for their own use.
  286.  
  287.  
  288. GraphPlot II version 1.0
  289. 27th May, 1993
  290.  
  291. Concurrent GraphPlot version 1.1
  292. 2nd July, 1993
  293.  
  294. Concurrent GraphPlot version 1.2
  295. 27th July, 1993